package cn.cdahua.basic.model;

public class SystemContext {
	/**
	 * 设置分页起始数
	 */
	private static ThreadLocal<Integer> offset = new ThreadLocal<Integer>();
	
	/**
	 * 设置分页大小
	 */
	private static ThreadLocal<Integer> pageSize = new ThreadLocal<Integer>();
	
	/**
	 * 设置排序字段
	 */
	private static ThreadLocal<String> order = new ThreadLocal<String>();
	/**
	 * 设置排序
	 */
	private static ThreadLocal<String> sort = new ThreadLocal<String>();
	/**
	 * 设置真实路径
	 */
	private static ThreadLocal<String> realPath = new ThreadLocal<String>();
	
	
	
	public static Integer getOffset() {
		return offset.get();
	}
	public static void setOffset(Integer _pageOffset) {
		offset.set(_pageOffset);;
	}
	public static Integer getPageSize() {
		return pageSize.get();
	}
	public static void setPageSize(Integer _pageSize) {
		pageSize.set(_pageSize);
	}
	public static String getOrder() {
		return order.get();
	}
	public static void setOrder(String _order) {
		order.set(_order);
	}
	public static String getSort() {
		return sort.get();
	}
	public static void setSort(String _order) {
		sort.set(_order);
	}
	public static void removeOffset(){
		offset.remove();
	}
	public static void removePageSize(){
		pageSize.remove();
	}
	public static void removeOrder(){
		order.remove();
	}
	public static void removeSort(){
		sort.remove();
	}
	public static String getRealPath() {
		return realPath.get();
	}
	public static void setRealPath(String _realPath) {
		realPath.set(_realPath);
	}
	
	public static void removeRealPath(){
		sort.remove();
	}
	
}
